package com.example.privacy;

import android.widget.TextView;
import androidx.appcompat.app.AppCompatActivity;
import android.content.Intent;
import android.os.Bundle;
import android.widget.ImageView;
import com.bumptech.glide.Glide;

public class ShowQRActivity extends AppCompatActivity {

    private ImageView qrIV;
    private String uuid ="";
    private TextView textViewUUID;

    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.activity_show_q_r);
        qrIV = (ImageView)findViewById(R.id.imageView2);
        System.out.println("调用这个活动");
        Intent i = getIntent();
        uuid = i.getStringExtra("uuid");
        textViewUUID = (TextView) findViewById(R.id.textViewUuid);
        textViewUUID.setText(uuid);
        getQR(uuid);
    }

    private void getQR(String uuid){
        String url = "http://api.qrserver.com/v1/create-qr-code/?size=300*300";
        url = url + String.format("&data=%s", uuid);
        Glide.with(this)
                .load(url)
                .error(R.mipmap.ic_launcher)
                .crossFade()
                .into(qrIV);
    }
}